#!/usr/bin/env python
# -*- coding: UTF-8 -*-

class Stack (object):
    def __init__(self, list=None, *arg):
        self.data = []
        if list is not None:
            self.data.extend(list)
        else:
            self.data.extend(arg)
    
    def put(self, item):
        self.data.append(item)
 
    def pop(self):
        item = self.data[-1]
        if self.data:
            self.data = self.data[:-2]
        else:
            print 'This stack is empty now'
        return item
        
    def __repr__(self):
        return repr(self.data)
    
    def isEmpty(self):
        if self.data:
            return False
        else:
            return True
        
if __name__ == '__main__':
    s = Stack('abc')
    s.put('d')
    s.pop()
    s.isEmpty()
    print s.data
